import request from '@/utils/request'

// 考勤设置
export const getAttendanceSetting = (data) => {
  return request({
    url: '/attendanceSetting/list',
    method: 'get',
    params:data
  })
}
//用户下拉列表
export const getUserList = (data) =>{
  return request({
    url:'/system/user/getUsers',
    method:'get'
  })
}
//新增考勤
export const addAttendanceSetting = (data) => {
  return request({
    url:'/attendanceSetting/add',
    method:'post',
    data
  })
}
//删除
export const deleteAttendanceSetting = (id) => {
  return request({
    url:`/attendanceSetting/remove/${id}`,
    method:'delete'
  })
}
//详情
export const getByIdAttendanceSetting = (id) => {
  return request({
    url:`/attendanceSetting/info/${id}`,
    method:'get'
  })
}
//修改
export const updateAttendanceSetting=(data)=>{
  return request({
    url:'/attendanceSetting/edit',
    method:'post',
    data
  })
}
//考勤数据
export const getAttendanceData=(data)=>{
  return request({
    url:'/attendance/list',
    method:"get",
    params:data
  })
}
//考勤统计列表
export const getAttendancetable=(data)=>{
  return request({
    url:'/attendance/listAnalyze',
    method:"get",
    params:data
  })
}
// 考勤统计图表
export const getAttendanceecharts=(data)=>{
  return request({
    url:'/attendance/chartAnalyze',
    method:'get',
    params:data
  })
}
/**上岗培训 */
export const getInductiontrainingList=(data)=>{
  return request({
    url:'/trainInfo',
    method:'get',
    params:data
  })
}
export const addInductiontraining=(data)=>{
  return request({
    url:'/trainInfo',
    method:'put',
    data
  })
} 
export const updateInductiontraining=(data)=>{
  return request({
    url:'/trainInfo',
    method:'post',
    data
  })
}
export const deleteInductiontraining=(id)=>{
  return request({
    url:`/trainInfo/${id}`,
    method:'delete'
  })
}
//文件上传
// export const uploadFile=(data)=>{
//   return request({
//     url:'/file/upload',
//     method:'post',
//     data
//   })
// }
export function uploadFile(data){
  return request({
    url:'/file/upload',
    method:'post',
    data
  })
}